program Project2;

{$APPTYPE CONSOLE}
{$R+;Q+}

uses
  SysUtils;

type
  tpoint = record
    x, y : extended;
  end;
  tvector = record
    x, y : extended;
  end;

var
  up, down : array[1..1000] of integer;
  point : array[1..1000] of tpoint;
  i, n, top1, top2 : integer;

function cross(v1, v2 : tvector) : extended;
begin
  result := v1.x * v2.y - v1.y * v2.x;
end;

function tovector(p1, p2 : tpoint) : tvector;
begin
  result.x := p2.x - p1.x;
  result.y := p2.y - p1.y;
end;

procedure push(id, num : integer);
begin
  if num = 1 then begin
    inc(top1);
    up[top1] := id;
  end else begin
    inc(top2);
    down[top2] := id;
  end;
end;

procedure swap(var a, b : tpoint);
var
  t : tpoint;
begin
  t := a;
  a := b;
  b := t;
end;

function less(p1, p2 : tpoint) : boolean;
begin
  result := (p1.x < p2.x) or ((p1.x = p2.x) and (p1.y < p2.y));
end;

procedure qsort(l, r : integer);
var
  q : tpoint;
  i, j : integer;
begin
  q := point[random(r - l) + l];
  i := l;
  j := r;
  while i <= j do begin
    while less(point[i], q) do inc(i);
    while less(q, point[j]) do dec(j);
    if i <= j then begin
      swap(point[i], point[j]);
      inc(i);
      dec(j);
    end;
  end;
  if l < j then
    qsort(l, j);
  if i < r then
    qsort(i, r);
end;

begin
  reset(input, 'input.txt');
  rewrite(output, 'output.txt');

  read(n);
  for i := 1 to n do
    read(point[i].x, point[i].y);

  qsort(1, n);

  push(1, 1);
  push(2, 1);
  for i := 3 to n do begin
    while (cross(tovector(point[up[top1 - 1]], point[up[top1]]),
                 tovector(point[up[top1 - 1]], point[i])) >= 0) and (top1 > 1) do
      dec(top1);
    push(i, 1);
  end;

  push(n, 2);
  push(n - 1, 2);
  for i := n - 2 downto 1 do begin
    while (cross(tovector(point[down[top2 - 1]], point[down[top2]]),
                 tovector(point[down[top2 - 1]], point[i])) >= 0) and (top2 > 1) do
      dec(top2);
    push(i, 2);
  end;

  writeln(top1 + top2 - 2);
  for i := 1 to top1 do
    writeln(point[up[i]].x:0:8, ' ', point[up[i]].y:0:8);

  for i := 2 to top2 - 1 do
    writeln(point[down[i]].x:0:8, ' ', point[down[i]].y:0:8);

end.
